﻿using Ewell.BizComponent.Charge.Model;
using FunnyArts.Wpf.ControlLibrary.Model;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace Ewell.BizComponent.Charge.UI.VM
{
    /// <summary>
    /// 收费步骤
    /// </summary>
    public class CashierStepVm : NotifyPropertyChanged
    {
        /// <summary>
        /// 序号
        /// </summary>
        private int _StepNumber;
        public int StepNumber
        {
            get { return _StepNumber; }
            set
            {
                if (this._StepNumber != value)
                {
                    _StepNumber = value;
                    OnPropertyChanged(nameof(StepNumber));
                }
            }
        }
        /// <summary>
        /// 名称
        /// </summary>
        private string _StepName;
        public string StepName
        {
            get { return this._StepName; }
            set
            {
                if (this._StepName != value)
                {
                    this._StepName = value;
                    OnPropertyChanged(nameof(StepName));
                }
            }
        }
        /// <summary>
        /// 状态
        /// </summary>
        private StepStatus _StepState;
        public StepStatus StepState
        {
            get { return (StepStatus)_StepState; }
            set
            {
                if (_StepState != value)
                {
                    _StepState = value;
                    OnPropertyChanged(nameof(StepState));
                }
            }
        }
        /// <summary>
        /// 错误信息
        /// </summary>
        private string _errorMsg;
        public string errorMsg { get { return _errorMsg; } set
            {
                if(this._errorMsg != value)
                {
                    _errorMsg = value;
                    OnPropertyChanged(nameof(errorMsg));
                }
            } }
        /// <summary>
        /// 页
        /// </summary>
        private Page _page;
        public Page page { get { return _page; } set
            {
                if (_page != value)
                {
                    _page = value;
                    OnPropertyChanged(nameof(Page));
                }
            }
        }
        /// <summary>
        /// 页VM
        /// </summary>
        private CashierBaseVm _pageViewModel { get; set; }
        public CashierBaseVm pageViewModel { get { return _pageViewModel; }set { 
                if(value != _pageViewModel)
                {
                    _pageViewModel = value;
                    OnPropertyChanged(nameof(pageViewModel));
                }
            } }
        public CashierContext context { get; set; }

        public delegate void StepLoading(CashierContext context);
        public delegate void StepHandler(CashierContext context);

        public StepLoading stepLoading { get; set; }
        public StepHandler stepHandler { get; set; }
    }
}
